3.1.88 \(\int \sqrt {1-\cos ^2(x)} \tan (x) \, dx\) [88]

Optimal. Leaf size=20 \[ \tanh ^{-1}\left (\sqrt {\sin ^2(x)}\right )-\sqrt {\sin ^2(x)} \]

[Out]

arctanh((sin(x)^2)^(1/2))-(sin(x)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3255, 3284, 52, 65, 212} \begin {gather*} \tanh ^{-1}\left (\sqrt {\sin ^2(x)}\right )-\sqrt {\sin ^2(x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[1 - Cos[x]^2]*Tan[x],x]

[Out]

ArcTanh[Sqrt[Sin[x]^2]] - Sqrt[Sin[x]^2]

Rule 52

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + n + 1))), x] + Dist[n*((b*c - a*d)/(b*(m + n + 1))), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3255

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*cos[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0]

Rule 3284

Int[((b_.)*sin[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = FreeFact
ors[Sin[e + f*x]^2, x]}, Dist[ff^((m + 1)/2)/(2*f), Subst[Int[x^((m - 1)/2)*((b*ff^(n/2)*x^(n/2))^p/(1 - ff*x)
^((m + 1)/2)), x], x, Sin[e + f*x]^2/ff], x]] /; FreeQ[{b, e, f, p}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2
]

Rubi steps

\begin {align*} \int \sqrt {1-\cos ^2(x)} \tan (x) \, dx &=\int \sqrt {\sin ^2(x)} \tan (x) \, dx\\ &=\frac {1}{2} \text {Subst}\left (\int \frac {\sqrt {x}}{1-x} \, dx,x,\sin ^2(x)\right )\\ &=-\sqrt {\sin ^2(x)}+\frac {1}{2} \text {Subst}\left (\int \frac {1}{(1-x) \sqrt {x}} \, dx,x,\sin ^2(x)\right )\\ &=-\sqrt {\sin ^2(x)}+\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {\sin ^2(x)}\right )\\ &=\tanh ^{-1}\left (\sqrt {\sin ^2(x)}\right )-\sqrt {\sin ^2(x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(47\) vs. \(2(20)=40\).
time = 0.03, size = 47, normalized size = 2.35 \begin {gather*} -\csc (x) \sqrt {\sin ^2(x)} \left (\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )+\sin (x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[1 - Cos[x]^2]*Tan[x],x]

[Out]

-(Csc[x]*Sqrt[Sin[x]^2]*(Log[Cos[x/2] - Sin[x/2]] - Log[Cos[x/2] + Sin[x/2]] + Sin[x]))

________________________________________________________________________________________

Maple [A]
time = 0.34, size = 17, normalized size = 0.85

method result size
default \(-\sqrt {\frac {1}{2}-\frac {\cos \left (2 x \right )}{2}}+\arctanh \left (\frac {2}{\sqrt {2-2 \cos \left (2 x \right )}}\right )\) \(17\)
risch \(-\frac {\sqrt {-\left ({\mathrm e}^{2 i x}-1\right )^{2} {\mathrm e}^{-2 i x}}\, {\mathrm e}^{2 i x}}{2 \left ({\mathrm e}^{2 i x}-1\right )}+\frac {\sqrt {-\left ({\mathrm e}^{2 i x}-1\right )^{2} {\mathrm e}^{-2 i x}}}{2 \,{\mathrm e}^{2 i x}-2}-\frac {i \sqrt {-\left ({\mathrm e}^{2 i x}-1\right )^{2} {\mathrm e}^{-2 i x}}\, {\mathrm e}^{i x} \ln \left ({\mathrm e}^{i x}-i\right )}{{\mathrm e}^{2 i x}-1}+\frac {i \sqrt {-\left ({\mathrm e}^{2 i x}-1\right )^{2} {\mathrm e}^{-2 i x}}\, {\mathrm e}^{i x} \ln \left ({\mathrm e}^{i x}+i\right )}{{\mathrm e}^{2 i x}-1}\) \(153\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1-cos(x)^2)^(1/2)*tan(x),x,method=_RETURNVERBOSE)

[Out]

-(sin(x)^2)^(1/2)+arctanh(1/(sin(x)^2)^(1/2))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 47 vs. \(2 (16) = 32\).
time = 0.48, size = 47, normalized size = 2.35 \begin {gather*} \frac {1}{2} \, \left (-1\right )^{2 \, \sin \left (x\right )} \log \left (-\frac {\sin \left (x\right )}{\sin \left (x\right ) + 1}\right ) + \frac {1}{2} \, \left (-1\right )^{2 \, \sin \left (x\right )} \log \left (-\frac {\sin \left (x\right )}{\sin \left (x\right ) - 1}\right ) - \sqrt {\sin \left (x\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-cos(x)^2)^(1/2)*tan(x),x, algorithm="maxima")

[Out]

1/2*(-1)^(2*sin(x))*log(-sin(x)/(sin(x) + 1)) + 1/2*(-1)^(2*sin(x))*log(-sin(x)/(sin(x) - 1)) - sqrt(sin(x)^2)

________________________________________________________________________________________

Fricas [A]
time = 0.40, size = 21, normalized size = 1.05 \begin {gather*} \frac {1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) - \sin \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-cos(x)^2)^(1/2)*tan(x),x, algorithm="fricas")

[Out]

1/2*log(sin(x) + 1) - 1/2*log(-sin(x) + 1) - sin(x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {- \left (\cos {\left (x \right )} - 1\right ) \left (\cos {\left (x \right )} + 1\right )} \tan {\left (x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-cos(x)**2)**(1/2)*tan(x),x)

[Out]

Integral(sqrt(-(cos(x) - 1)*(cos(x) + 1))*tan(x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 45 vs. \(2 (16) = 32\).
time = 0.46, size = 45, normalized size = 2.25 \begin {gather*} -\sqrt {-\cos \left (x\right )^{2} + 1} + \frac {1}{2} \, \log \left (\sqrt {-\cos \left (x\right )^{2} + 1} + 1\right ) - \frac {1}{2} \, \log \left (-\sqrt {-\cos \left (x\right )^{2} + 1} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-cos(x)^2)^(1/2)*tan(x),x, algorithm="giac")

[Out]

-sqrt(-cos(x)^2 + 1) + 1/2*log(sqrt(-cos(x)^2 + 1) + 1) - 1/2*log(-sqrt(-cos(x)^2 + 1) + 1)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.05 \begin {gather*} \int \mathrm {tan}\left (x\right )\,\sqrt {1-{\cos \left (x\right )}^2} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)*(1 - cos(x)^2)^(1/2),x)

[Out]

int(tan(x)*(1 - cos(x)^2)^(1/2), x)

________________________________________________________________________________________